package com.wz.compiler.expr;

import com.wz.compiler.ArrayInit.ShortToUnicodeString;
import org.antlr.v4.runtime.CharStream;
import org.antlr.v4.runtime.CharStreams;
import org.antlr.v4.runtime.CommonTokenStream;
import org.antlr.v4.runtime.tree.ParseTreeWalker;

import java.io.IOException;

public class ExprTest {

    public static void main(String[] args) throws IOException {
        System.out.println("plz input:");

        CharStream input = CharStreams.fromStream(System.in);
        ExprLexer lexer = new ExprLexer(input);
        CommonTokenStream tokens = new CommonTokenStream(lexer);
        ExprParser parser = new ExprParser(tokens);

        ExprParser.ProgContext progContext = parser.prog();

        System.out.println(progContext.toStringTree(parser));
//
//        ParseTreeWalker walker = new ParseTreeWalker();
//
//        walker.walk(new ShortToUnicodeString(), statContext.getRuleContext());
//        System.out.println("\n");
    }
}
